package cn.ac.siom.query.dao.impl;

import cn.ac.siom.query.dao.IItem_infoDAO;
import cn.ac.siom.query.dao.ITab_articleDAO;
import cn.ac.siom.query.vo.Item_info;
import cn.ac.siom.query.vo.Tab_article;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

@Repository
public class Tab_articleDAOImpl extends SqlSessionDaoSupport implements ITab_articleDAO {
    @Autowired
    public Tab_articleDAOImpl(SqlSessionFactory sqlSessionFactory){
        super.setSqlSessionFactory(sqlSessionFactory);
    }


    @Override
    public boolean doCreate(Tab_article vo) throws SQLException {
        return false;
    }

    @Override
    public boolean doUpdate(Tab_article vo) throws SQLException {
        return false;
    }

    @Override
    public boolean doRemove(Set<?> ids) throws SQLException {
        return false;
    }

    @Override
    public Tab_article findById(Integer id) throws SQLException {
        return null;
    }

    @Override
    public List<Tab_article> findAll() throws SQLException {
        return super.getSqlSession().selectList("Tab_articleNS.findAll");
    }

    @Override
    public List<Tab_article> findAllBySplit(String column, String keyWord, Integer currentPage, Integer lineSize) throws SQLException {
        return null;
    }


    @Override
    public Integer getAllCount(String column, String keyWord) throws SQLException {
        return null;
    }


    @Override
    public List<Tab_article> findNo(Integer id) throws SQLException {
        Map<String, Integer> map= new HashMap<>();
        map.put("i_id",id);
        return super.getSqlSession().selectList("Tab_articleNS.findNo", map);
    }
}
